//
//  PicsViewController.m
//  News_lzz
//
//  Created by qianfeng01 on 15-6-14.
//  Copyright (c) 2015年 李忠. All rights reserved.
//

#import "PicsViewController.h"
#import "PicsCell.h"

@interface PicsViewController ()

@end

@implementation PicsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self firstDo];
    [self requestNetAndDownloadDataWithUrlType:self.typeArr[0]];
}

- (void)firstDo {
    self.tableView.rowHeight = 194;
    [self.tableView registerNib:[UINib nibWithNibName:@"PicsCell" bundle:nil] forCellReuseIdentifier:@"PicsCell"];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    PicsCell *picsCell = [tableView dequeueReusableCellWithIdentifier:@"PicsCell" forIndexPath:indexPath];
    return [picsCell setCellWithModel:self.dataArr[indexPath.row]];
}

- (void)itemClick:(UIBarButtonItem *)item {
    switch (item.tag) {
        case 201:
        {//图片
            [self requestNetAndDownloadDataWithUrlType:self.typeArr[0]];
        }
            break;
        case 202:
        {//趣图
            [self requestNetAndDownloadDataWithUrlType:self.typeArr[1]];
        }
            break;
        case 203:
        {
            
        }
            break;
        case 204:
        {
            
        }
            break;
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
